package com.example.auv_660.util;

import android.Manifest;

import java.text.DecimalFormat;

public class Constants {
    public static final int UDP_SERVER_PORT = 13141;         // 6777
    public static final int TCP_SERVER_PORT = 20000;        // 16777
//    public static final String UDP_SERVER_IP = "192.168.43.91";
//    public static final String TCP_SERVER_IP = "192.168.43.91";
//    public static final String SERVER_IP = "192.168.43.91";
    public static final String SERVER_IP = "192.168.0.108";
//    public static final String UDP_SERVER_IP = "118.24.72.202";
//    public static final String TCP_SERVER_IP = "118.24.72.202";
//    public static final String PROPELLER_IP = "192.168.43.7";
//    public static final String DEPTH_SENSOR_IP = "192.168.43.100";
    public static final String PROPELLER_IP = "192.168.43.10";
    public static final String BATTER_IP = "192.168.43.20";
    public static final String DEPTH_SENSOR_IP = "192.168.43.30";
    public static final String LIGHT_IP = "192.168.43.5";
    public static final String START_AUTO_CONTROL_ORDER = "afa";    // 直航标识符
    public static final String START_AUTO_CONTROL_GPS = "gps";      // 导航标识符
    public static final String CHECK_AUV_MODEL_STATE_ORDER = "Self-State";
    public static final String CHECK_AUV_INFORMATION = "AUV-information";   // 信息查询标识
    public static final String CHECK_AUV_MODEL_TCP_HEALTH_ORDER = "AUVModelTCPHealthCheck";
    public static final String CHECK_AUV_MODEL_HARDWARE_SELF_TEST_ORDER = "Self-Test";
    public static final String AUV_PROPELLER_ORDER_PREFIX = "$CTL,Driver,";
    public static final String AUV_LIGHT_ORDER_PREFIX = "$CTL,LED,";
    public static final String AUV_SELF_TEST_PROPELLER_ORDER_I = "-15,-15,-15,-15,-2000";
    public static final String AUV_SELF_TEST_PROPELLER_ORDER_II = "0,0,0,0,0";
    public static final String AUV_SELF_TEST_PROPELLER_ORDER_III = "15,15,15,15,2000";
    public static final String AUV_DOWN_WATER = "0,0,15,-20,3000";
//    public static final String AUV_SELF_TEST_LIGHT_ORDER_I = "R";
//    public static final String AUV_SELF_TEST_LIGHT_ORDER_II = "G";
//    public static final String AUV_SELF_TEST_LIGHT_ORDER_III = "B";
//    public static final String AUV_SELF_TEST_LIGHT_ORDER_IIII = "OFF";
    public static final String AUV_ORDER_SUFFIX = "*\r\n";
    public static final String CHECK_AUV_MODEL_STATE_ANSWER = "$Answer#AUV,";
    public static final String FILE_WRITE_CMD_PATH = "CMD/";
    public static final String FILE_WRITE_TASK_PATH = "TASK/";
    public static final String FILE_WRITE_TEST_PATH = "TEST/";
    public static final String FILE_WRITE_STATE_PATH = "AUV_STATE/";
    public static final String FILE_WRITE_AUTO_PATH = "AUV_AUTO/";
    public static final String TASKINFORMATION = "TASKINFORMATION";
    public static final String TESTINFORMATION = "test";
    public static final String DH = "AUV_DATA_DH/";
    public static final String DS = "AUV_DATA_DS/";
    public static final int SPEEDPOINT = 10;
    public static final double REACH_RADIUS = 10.0;
    public static final double DT = 0.1;
    public static final double GPS_ACCURACY = 10.0;
    public static double CANNOTDEPTH = 40.0;
    public static double SPEED = 0.0;
    public static int OPENGPSHELP = 0;
    public static String FILE_PATH = "";

    public final static String[] PERMISSIONS = {
            Manifest.permission.READ_PHONE_STATE,
            Manifest.permission.WRITE_EXTERNAL_STORAGE,
            Manifest.permission.ACCESS_COARSE_LOCATION,
            Manifest.permission.ACCESS_FINE_LOCATION,
            Manifest.permission.ACCESS_NETWORK_STATE,
            Manifest.permission.READ_EXTERNAL_STORAGE,
            Manifest.permission.ACCESS_LOCATION_EXTRA_COMMANDS,
            Manifest.permission.ACCESS_WIFI_STATE,
    };

    public static String PHONEIMEI = "";

    public static DecimalFormat keepnumber = getKeepNumber();

    public static DecimalFormat getKeepNumber()
    {
        DecimalFormat df = new DecimalFormat("0.00000");
        return df;
    }

    public static boolean RUN = true;       // 紧急停车
    public static boolean ORDER = true;     // 单线程命令执行
    public static boolean PROPELLER = true;
    public static int DHWARNNING = 0;       // 任务异常警告
    public static double RDDPARA = 0.5;     // 算法系数
    public static double D1 = 0.1;          // 算法系数
    public static double D2 = 1.0;          // 算法系数
    public static double S1 = 0.5;          // 算法系数
    public static double chadong = 1;       // 算法系数
}
